<?php
/**
 * GetNodeInfoApi.class.php 
 * 
 *
 * @author     late.xiao@qq.com
 */
namespace Sysblog\Api;

use Base\Lib\Implement\Api;

class GetNodeInfoApi implements Api
{
    public $api_desc = '获取类目详情';
    public function getParams()
    {
        $params = array(
                'node_id' =>array('type'=>'int','valid'=>'required','default'=>'','title'=>'类目ID'),
                'fields' =>array('type'=>'string','valid'=>'','default'=>'*','title'=>'返回的字段'),
        );
        
        return $params;
    }
    
    public function getInfo($params)
    {
        if(!$params['node_id'])
        {
            return false;
        }
        
        $field = '*';
        if($params['fields'])
        {
            $field = $params['fields'];
        }
        
        $obj_serv = D('Sysblog/Category', 'Service');
        $data = $obj_serv->getCatRow($params['node_id'], $field);
        
        return $data;
    }
}
 